<#include "common/layout.ftl"/>
<@layout "我的消息">
    <div class="layui-container fly-marginTop fly-user-main">
        <@centerLeft index=3></@centerLeft>

        <div class="site-tree-mobile layui-hide">
            <i class="layui-icon">&#xe602;</i>
        </div>
        <div class="site-mobile-shade"></div>

        <div class="site-tree-mobile layui-hide">
            <i class="layui-icon">&#xe602;</i>
        </div>
        <div class="site-mobile-shade"></div>

        <div class="fly-panel fly-panel-user" pad20>
            <div class="layui-tab layui-tab-brief" lay-filter="user" id="LAY_msg" style="margin-top: 15px;">
                <button class="layui-btn layui-btn-danger" id="LAY_delallmsg">清空全部消息</button>
                <div id="LAY_minemsg" style="margin-top: 10px;">
                    <ul class="mine-msg">
                        <#list pageData.records as message>
                            <li data-id="${message.id}">
                                <blockquote class="layui-elem-quote">
                                    <#if message.type==0>
                                        系统消息：${message.content}
                                    </#if>
                                    <#if message.type==1>
                                        <a href="${basePath}/user/${message.fromUserId}" target="_blank"><cite>${message.fromUserName}</cite></a>
                                        评论了您的文章<a target="_blank" href="${basePath}/post/${message.postId}"><cite>${message.postTitle}</cite></a>: ${message.content}
                                    </#if>
                                    <#if message.type==2>
                                        <a href="${basePath}/user/${message.fromUserId}" target="_blank"><cite>${message.fromUserName}</cite></a>
                                        回复了您的评论<cite>${message.commentContent}</cite>: ${message.content}
                                    </#if>
                                </blockquote>
                                <p>
                                    <span>${timeAgo(message.createTime)}</span>
                                    <a href="javascript:;" class="layui-btn layui-btn-small layui-btn-danger fly-delete">删除</a>
                                </p>
                            </li>
                        </#list>
                        <#if pageData.total == 0>
                            <div class="fly-none">您暂时没有最新消息</div>
                        </#if>
                    </ul>

                    <#-- 分页 -->
                    <#if pageData.total gt 0>
                        <@paging pageData></@paging>
                    </#if>
                </div>
            </div>
        </div>
    </div>
    <script>
        layui.cache.page = 'user';
    </script>
</@layout>